<template>
  <div>
    <button  @click="discount">-</button>
    <span>{{ price }}</span>
    <button  @click="add">+</button>
  </div>
</template>

<script>
export default {
  name: 'NumberBox',
  props: ['price'],
  methods: {
    discount() {
      this.$emit('input', this.price - 1)
    },
    add() {
      this.$emit('input', this.price + 1)
    },
  },
}
</script>

<style lang="less" scoped>
span {
  display: inline-block;
  margin: 0 5px;
}
</style>
